import 'package:json_annotation/json_annotation.dart';

part 'daily_events_models.g.dart';

/// 标签信息模型
@JsonSerializable()
class TagInfo {
  final int? id;
  final String? tagCode;
  final String? tagName;
  final int? userId;
  final String? dailyValue;

  TagInfo({
    this.id,
    this.tagCode,
    this.tagName,
    this.userId,
    this.dailyValue,
  });

  factory TagInfo.fromJson(Map<String, dynamic> json) => _$TagInfoFromJson(json);
  Map<String, dynamic> toJson() => _$TagInfoToJson(this);
}

/// 标签分组模型
@JsonSerializable()
class TagGroup {
  final int? tagType;
  final List<TagInfo>? tagInfos;

  TagGroup({
    this.tagType,
    this.tagInfos,
  });

  factory TagGroup.fromJson(Map<String, dynamic> json) => _$TagGroupFromJson(json);
  Map<String, dynamic> toJson() => _$TagGroupToJson(this);
}

/// API响应模型
@JsonSerializable()
class DailyTagsResponse {
  final String? msg;
  final int? code;
  final List<TagGroup>? data;

  DailyTagsResponse({
    this.msg,
    this.code,
    this.data,
  });

  factory DailyTagsResponse.fromJson(Map<String, dynamic> json) => _$DailyTagsResponseFromJson(json);
  Map<String, dynamic> toJson() => _$DailyTagsResponseToJson(this);
}
